package today.rocky.boot.shiro.mapper;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;
import today.rocky.boot.shiro.entity.User;

/**
 * @author Rocky
 * @version 1.0
 * @date 2020/4/14 13:53
 */

@Mapper
@Repository
public interface UserMapper {

	/**
	 * 根据查询对象信息
	 * @param name 名字
	 * @return 对象
	 */
	@Select(value = "select id,name,password from t_user where name=#{name}")
	User findByName(String name);

	/**
	 * 根据id对象信息
	 * @param id 名字
	 * @return 对象
	 */
	@Select(value = "SELECT id,name,password,perms from t_user where id = #{id}")
	User findById(Integer id);
}